The present invention relates generally to computing systems, and more particularly to system, method, and apparatus for streaming data transfers to and/or from scattered or non-contiguous locations in a memory.
In a computing system, related data, in the form of an executable file or data set, often is required to be stored in a memory element in blocks which may not be contiguous. While it may be ideal to store related data at contiguous locations in a memory, memory is not always able to be allocated to support this type of storage., for example, when the required number of storage locations is not available in a contiguous block. Problems arise in the transfer of this type of dispersed (yet related) data to and from a memory device. For example, system memory for a computing system may contain blocks of related data which are dispersed across system memory. When the blocks of related data are required for local processing, the processor (or some other resource) must oversee the gathering of the dispersed related data for transfer into local memory.
The transfer of xe2x80x9cscatteredxe2x80x9d data may be overseen by the processor. That is, the processor may be required to keep track of the scattered locations in memory associated with the related data blocks and also track the progress of the transfer. Alternatively, a scatter/gather mechanism may be employed. A scatter/gather mechanism is commonly used to stream data transfers from scattered locations or to a gathered location in a memory. A scatter/gather mechanism transfers scattered data without requiring processor (firmware) intervention. In operation, upon identifying an object (related data) for transfer, executing firmware or software creates a linked list of memory locations to be retrieved. This list (the xe2x80x9cscatter/gather listxe2x80x9d) is transferred to a scatter/gather mechanism, which performs transfers using the list. Each individual segment in a scatter/gather list includes information about the data to be transferred and a linking address to the next address in memory for a next list segment to be processed. Individual list segments are processed by the scatter/gather mechanism sequentially until the end of the scatter/gather list is reached.
In some situations, a problem arises in the use of the scatter/gather mechanism. Typically in conventional systems and methods, once a scatter/gather mechanism begins the processing of a scatter/gather list, the resources associated with the transfer cannot be shared by others. Accordingly, transfer resources, such as a Direct Memory Access (DMA) engine associated with the scatter/gather processing, are dedicated to that process and cannot be used or shared by any other process until the processing of a scatter/gather list has been completed. Typically, if a processor (CPU) desired to interrupt the scatter/gather mechanism, any scatter/gather operation in progress had to be aborted. This was due primarily to the lack of visibility that the processor has to the scatter/gather operation.
Alternatively, software or firmware in the computing system can be used to track the status of the hardware as it progresses through the scatter/gather list processing. While this type of solution might allow for the interruption of a scatter gather operation, it minimizes the efficiency gains achieved in having separate scatter/gather hardware.
There therefore remains a need for a system and method that provide a scatter/gather mechanism which is able to be interrupted during scatter/gather list processing and which is capable of resuming processing of an interrupted scatter/gather list at a future time.
A method of streaming data transfers from scattered locations or to a gathered location in a memory, including the steps of manipulating the transfer of data between memory devices by processing, an element at a time, entries in a first scatter/gather list; upon receipt of a request to process a second scatter/gather list, interrupting the processing of the first scatter/gather list; and resuming the processing of the first scatter/gather list upon the completion of the processing of the second scatter/gather list. In one embodiment, this first method is further defined such that the step of interrupting the processing of the first scatter gather list interrupts only at the completion of the processing of an element of the first scatter/gather list and prior to the retrieval of the next element in the first scatter/gather list. In another embodiment, the method is further defined such that interrupting step further includes storing the next address to be processed in the first scatter/gather list, and retrieving the first element in the second scatter/gather list.
In yet another embodiment, the method is further defined such that the first scatter/gather list has a first priority, and the second scatter/gather list has a second priority; and the interrupting step is only performed if the priority of the second scatter/gather list is higher than the priority of the first scatter/gather list. This latter embodiment may also optionally provide that if the priority of the second scatter/gather list is lower than the priority of the first scatter/gather list, the method further comprises the step of delaying the processing of the second scatter/gather list until the processing of the first scatter/gather list is complete. This may be further defined to optionally provide that the step of delaying the processing of the second scatter/gather list further includes the step of storing the address in memory of the first element of the second scatter/gather list.
In another embodiment the invention provides a scatter/gather mechanism for streaming transfers between a first and second memory device without processor or firmware intervention. The the scatter/gather mechanism comprises: a transfer engine for streaming data transfers between dispersed locations in one memory device to a gathered location in a second memory device, means for suspending the processing of a current transfer request upon the receipt of a second transfer request, and means for resuming the processing of a suspended transfer request including a return pointer for indicating the starting address of a next element to be processed in an transfer operation which has been suspended.
In yet another embodiment, the invention provides a scatter/gather mechanism for streaming transfers of data between a first and second memory device without processor or firmware intervention where the data is transferred between the memory devices in segments according to instructions in a scatter/gather list, and where the scatter/gather mechanism services a single transfer request at a time. The scatter/gather mechanism includes a transfer engine for streaming transfers between dispersed locations in one memory device to a gathered location in a second memory device; and a transfer controller for processing transfer requests including a processing procedure for processing a scatter/gather list associated with a current transfer request, and an interrupt procedure for servicing a priority transfer request by suspending the current transfer request until the completion of the servicing of the priority transfer request.
In still another embodiment, the invention provides a computer system including a processor and first and second memory devices where the computer system includes: means for streaming transfers of data between the first and the second memory devices without intervention of the processor or firmware and including a scatter/gather means, where the data is transferred between the first and second memory device in segments according to instructions in a scatter/gather list, the scatter/gather means services a single transfer request at a time; and the scatter/gather means further includes a transfer engine streaming transfers between dispersed locations in the first memory device to a gathered location in a second memory device, and a transfer controller for processing transfer requests including: first processing means for processing a scatter/gather list associated with a current transfer request, and an interrupt means for servicing a priority transfer request by suspending the current transfer request until the completion of the servicing of the priority transfer request.
The invention also provides computer program, software, and firmware providing a computer program mechanism including a program module that directs the computer system or components thereof, to function in a specified manner to stream data transfers from scattered locations or to a gathered location in a memory, the program module including instructions for: manipulating the transfer of data between memory devices by processing, an element at a time, entries in a first scatter/gather list; and upon receipt of a request to process a second scatter/gather list, interrupting the processing of the first scatter/gather list; and resuming the processing of the first scatter/gather list upon the completion of the processing of the second scatter/gather list.
In a further embodiment of the invention, multiply nested processing is provided in association with the above described system, apparatus, method, and computer program and computer program product.
The invention provides several features and advantages over conventional systems and methods. One advantage is that multiple scatter/gather operations may be prioritized and processed by the scatter/gather mechanism. Another advantage is that a processor may assign a priority to a scatter/gather operation and interrupt an ongoing scatter/gather operation in order to allow for the processing of a higher priority task. Hence the invention provides prioritized switching between tasks. Yet another feature and advantage of the invention is that it is simpler in design and the use of a single scatter/gather engine and a single DMA engine that are shared by multiple prioritized scatter/gather lists reduces costs and required silicon (chip) area as compared to providing multiple scatter/gather engines and multiple DMA engines to support multiple prioritized scatter/gather list. Furthermore, the processor or CPU does not have to be involved (xe2x80x9cbaby sitxe2x80x9d) the ongoing scatter/gather operation thus reduces overhead and improves overall system performance, this because it is done automatically through the prioritized scatter/gather context switching. Other advantages and features will be apparent from the following description and claims.